A data model describes how data can be stored and accessed. More formally, data models define data entities and relationships between the data entities. The primary objective of a data model is to provide a definition and format of data to facilitate management and processing of large quantities of data. One application of data models is database models, which define how a database or other store is structured and utilized. A database model can be relational or non-relational.
In a relational model, or more particularly a relational database, data is structured in terms of one or more tables. Tables are relations that comprise a number of columns and rows, wherein the named columns are referred to as attributes and rows capture data for specific entity instances. For example, a table can capture information about a particular entity such as a book in rows, also called tuples, and columns. The columns identify various attributes of an entity such as the title, author, and year of publication of a book. The rows capture an instance of an entity such as a particular book. In other words, each row in the table represents attributes of a particular book. Further yet, a table can include primary and foreign keys that enable two or more tables to be linked together.
Amongst many implementations a non-relational model, a key-value model is one of the most popular. Key-value databases or stores represent a simple data model that maps unique keys to a set of one or more values. More specifically, the key-value store stores values and an index to facilitate location of the stored values based on a key. For example, a key be located that identifies one of a title, author, or publication of a data of a book.
Relational databases are often referred to as SQL databases while some non-relational databases are called NoSQL databases or stores. SQL stands for Structured Query Language, which is the primary language utilized to query and update data in a relational database. When SQL is utilized in conjunction with a relational database, the database can be referred to as a SQL-based relational database. However, more often a SQL-based relational database is simply referred to as a SQL database and used as a synonym for a relational database. NoSQL is a term utilized to designate databases that differ from SQL-based relational databases. In other words, the term NoSQL is used as a synonym for a non-relational database or store such as but not limited to a key-value store.
SQL databases and NoSQL stores have a number of advantages and disadvantages that are captured at a high level by the CAP theorem, which states that of consistency (C), availability (A), and partition tolerance (P) only two can be guaranteed at any one time. Consistency refers to a characteristic of a system to remain in a consistent state after an operation such as an update. Availability concerns remaining operational over a period of time, even with the presence of failures, and partition tolerance refers to the ability of a system to operate across network partitions. Typically, the design choice for SQL databases is to choose consistency and availability over partition tolerance, and for NoSQL stores to drop consistency in favor or partition tolerance and availability. In other words, NoSQL stores sacrifice consistency for scalability or alternatively SQL databases sacrifice scalability for consistency.
With continued emergence of network-based or “Cloud” computing, NoSQL stores have received a lot of attention recently at least because of their scalability. At the same time, some in the industry have expressed concern as to the future of SQL databases in this and other contexts.